<html>
<head><meta charset="utf-8"><title>Update / [patch] issue 9470 · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Update.20.2F.20.5Bpatch.5D.20issue.209470.html">Update / [patch] issue 9470</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239727432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Update%20/%20%5Bpatch%5D%20issue%209470/near/239727432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matt Taylor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Update.20.2F.20.5Bpatch.5D.20issue.209470.html#239727432">(May 21 2021 at 10:19)</a>:</h4>
<p>I think I've narrowed down this bug a bit more (<a href="https://github.com/rust-lang/cargo/issues/9470">https://github.com/rust-lang/cargo/issues/9470</a>)</p>
<p>What seems to happen is that we expect the <code>source.precise()</code> function to tell us if a pkg was specified with <code>--precise</code>, but we <em>call it on the wrong source</em> - we call it on the registry source rather than the patch source, but <code>.precise()</code> returns None on the former (and the correct thing on the latter)</p>
<p>Here is where we find the source: <a href="https://github.com/rust-lang/cargo/blob/6ca6dd0bffaf8d4011f1c8793dcb534838b788a8/src/cargo/core/registry.rs#L589">https://github.com/rust-lang/cargo/blob/6ca6dd0bffaf8d4011f1c8793dcb534838b788a8/src/cargo/core/registry.rs#L589</a><br>
Here is where we filter based on <code>source.precise()</code>: <a href="https://github.com/rust-lang/cargo/blob/f99f96583c9d7759c067b8c8558065c01927b63e/src/cargo/sources/registry/index.rs#L468">https://github.com/rust-lang/cargo/blob/f99f96583c9d7759c067b8c8558065c01927b63e/src/cargo/sources/registry/index.rs#L468</a></p>
<p>TL;DR if our lockfile contains a patched dep, then we look at the wrong source to figure out whether <code>precise</code> was specified or not</p>
<p>any thoughts / ideas how to go about fixing it?</p>



<a name="240326437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Update%20/%20%5Bpatch%5D%20issue%209470/near/240326437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matt Taylor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Update.20.2F.20.5Bpatch.5D.20issue.209470.html#240326437">(May 26 2021 at 13:44)</a>:</h4>
<p>would it be rude to ping alex since he seems to have written most of the existing patch-related code <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="240387984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Update%20/%20%5Bpatch%5D%20issue%209470/near/240387984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Update.20.2F.20.5Bpatch.5D.20issue.209470.html#240387984">(May 26 2021 at 20:40)</a>:</h4>
<p>Heh pinging me is fine, although I typically take a long time to look into <code>[patch]</code> issues since everything is so complicated and I get less and less willing to page it all in over time. I'm happy to take a look at a PR though! I don't know off-hand what would cause this issue just looking at the title though</p>



<a name="240447083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Update%20/%20%5Bpatch%5D%20issue%209470/near/240447083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matt Taylor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Update.20.2F.20.5Bpatch.5D.20issue.209470.html#240447083">(May 27 2021 at 10:42)</a>:</h4>
<p>yeah that’s fair enough, i think i know what the issue is but the fix isn’t very clear to me, i’ll try to draw something up though</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>